package org.teremail.smtp.commands;

import java.util.List;

import org.teremail.smtp.SMTPCommandFactory;
import org.teremail.smtp.SMTPSession;

public class RSETCommand extends SMTPCommand {

    public RSETCommand() {
        super("RSET", EMPTY);
    }
    
    @Override
    public void process(SMTPSession session) {
        session.setSender(null);
        session.clearRecipients();
        session.clearData();
        session.write(MSG_OK);
    }

    public static final SMTPCommandFactory FACTORY = new SMTPCommandFactory() {
        public SMTPCommand create(List<String> parameters) {
            return new RSETCommand();
        }
    };
}
